package com.personal.gateway.constant;

@Deprecated
public class FlinkCommandConstantOld {

    public static String SAVE_POINT_PREFIX = "flink-k8s-savepoint";

    public static String OSS_ENDPOINT = "oss-cn-zhangjiakou-internal.aliyuncs.com";
    public static String OSS_ACCESS_KEY_ID = "";
    public static String OSS_ACCESS_KEY_SECRET = "";

    public final static String START_NO_SAVE_POINT =
            "/home/flink-${flink_version}/bin/flink" +
                    "\nrun-application" +
                    "\n-c" +
                    "\n${start_class}" +
                    "\n--target" +
                    "\nkubernetes-application" +
                    "\n-Dkubernetes.cluster-id=${cluster_id}" +
                    "\n-Dkubernetes.container.image=${docker_image}" +
                    "\n-Dkubernetes.container.image.pull-policy=Always" +
                    "\n-Dkubernetes.container.image.pull-secrets=docker-login" +
                    "\n-Dkubernetes.namespace=flink" +
                    "\n-Dkubernetes.service-account=flink-sa" +
                    "\n-Dkubernetes.taskmanager.cpu=1" +
                    "\n-Dkubernetes.rest-service.exposed.type=ClusterIP" +
                    // "\n-Dkubernetes.container-start-command-template=%java% %classpath% %jvmmem% %jvmopts% %logging% %class% %args%" +
                    // "\n-Dlog4j.configurationFile=/opt/flink/initConf/log4j2.xml" +
                    "\n-Djobmanager.memory.process.size=4096m" +
                    "\n-Dtaskmanager.memory.process.size=${task_manager_memory}" +
                    "\n-Dtaskmanager.numberOfTaskSlots=1" +
                    "\n-Dfs.oss.endpoint=" + OSS_ENDPOINT +
                    "\n-Dfs.oss.accessKeyId=" + OSS_ACCESS_KEY_ID +
                    "\n-Dfs.oss.accessKeySecret=" + OSS_ACCESS_KEY_SECRET +
                    "\n-Dmetrics.reporter.influxdb.scheme=http" +
                    "\n-Dmetrics.reporter.influxdb.factory.class=org.apache.flink.metrics.influxdb.InfluxdbReporterFactory" +
                    "\n-Dmetrics.reporter.influxdb.host=influxdb-svc.default" +
                    "\n-Dmetrics.reporter.influxdb.port=8086" +
                    "\n-Dmetrics.reporter.influxdb.db=flink_monitor" +
                    "\n-Dmetrics.reporter.influxdb.retentionPolicy=3_days" +
                    "\n-Dmetrics.reporter.influxdb.consistency=ANY" +
                    "\n-Dmetrics.reporter.influxdb.connectTimeout=60000" +
                    "\n-Dmetrics.reporter.influxdb.writeTimeout=60000" +
                    "\n-Dmetrics.reporter.influxdb.interval=60s" +
                    "\n-Dhigh-availability=org.apache.flink.kubernetes.highavailability.KubernetesHaServicesFactory" +
                    "\n-Dhigh-availability.storageDir=oss://bucket-flink/flink-k8s-recovery/${high_env}/${high_name}/" +
                    "\nlocal:///opt/flink/usrlib/${start_jar}" +
                    "\n--env" +
                    "\n${start_env}";

    public final static String START_WITH_SAVE_POINT =
            "/home/flink-${flink_version}/bin/flink" +
                    "\nrun-application" +
                    "\n-c" +
                    "\n${start_class}" +
                    "\n-e" +
                    "\nkubernetes-application" +
                    "\n-s" +
                    "\noss://bucket-flink/${start_save_point_path}" +
                    "\n-Dkubernetes.cluster-id=${cluster_id}" +
                    "\n-Dkubernetes.container.image=${docker_image}" +
                    "\n-Dkubernetes.container.image.pull-policy=Always" +
                    "\n-Dkubernetes.container.image.pull-secrets=docker-login" +
                    "\n-Dkubernetes.namespace=flink" +
                    "\n-Dkubernetes.service-account=flink-sa" +
                    "\n-Dkubernetes.rest-service.exposed.type=ClusterIP" +
                    "\n-Dkubernetes.taskmanager.cpu=1" +
                    // "\n-Dkubernetes.container-start-command-template=%java% %classpath% %jvmmem% %jvmopts% %logging% %class% %args%" +
                    // "\n-Dlog4j.configurationFile=/opt/flink/initConf/log4j2.xml" +
                    "\n-Djobmanager.memory.process.size=4096m" +
                    "\n-Dtaskmanager.memory.process.size=${task_manager_memory}" +
                    "\n-Dtaskmanager.numberOfTaskSlots=1" +
                    "\n-Dfs.oss.endpoint=" + OSS_ENDPOINT +
                    "\n-Dfs.oss.accessKeyId=" + OSS_ACCESS_KEY_ID +
                    "\n-Dfs.oss.accessKeySecret=" + OSS_ACCESS_KEY_SECRET +
                    "\n-Dmetrics.reporter.influxdb.scheme=http" +
                    "\n-Dmetrics.reporter.influxdb.factory.class=org.apache.flink.metrics.influxdb.InfluxdbReporterFactory" +
                    "\n-Dmetrics.reporter.influxdb.host=influxdb-svc.default" +
                    "\n-Dmetrics.reporter.influxdb.port=8086" +
                    "\n-Dmetrics.reporter.influxdb.db=flink_monitor" +
                    "\n-Dmetrics.reporter.influxdb.retentionPolicy=3_days" +
                    "\n-Dmetrics.reporter.influxdb.consistency=ANY" +
                    "\n-Dmetrics.reporter.influxdb.connectTimeout=60000" +
                    "\n-Dmetrics.reporter.influxdb.writeTimeout=60000" +
                    "\n-Dmetrics.reporter.influxdb.interval=60s" +
                    "\n-Dhigh-availability=org.apache.flink.kubernetes.highavailability.KubernetesHaServicesFactory" +
                    "\n-Dhigh-availability.storageDir=oss://bucket-flink/flink-k8s-recovery/${high_env}/${high_name}/" +
                    "\nlocal:///opt/flink/usrlib/${start_jar}" +
                    "\n--env" +
                    "\n${start_env}";

    public final static String STOP_WITH_SAVE_POINT =
            "/home/flink-${flink_version}/bin/flink" +
                    "\nstop" +
                    "\n-e" +
                    "\nkubernetes-application" +
                    "\n-Dkubernetes.namespace=flink" +
                    "\n-Dkubernetes.service-account=flink-sa" +
                    "\n-Dkubernetes.cluster-id=${cluster_id}" +
                    "\n-p" +
                    "\noss://bucket-flink/${stop_save_point_path}/${stop_save_point_env}/${stop_save_point_name}/" +
                    "\n00000000000000000000000000000000";
}
